<?php
/**
 * Created by PhpStorm.
 * User: HP
 * Date: 2018/9/11
 * Time: 16:13
 */
namespace App\Http\Middleware;

use Closure;
use Illuminate\Support\Facades\Auth;
use DB;

class CheckAuth
{
    public function handle($request, Closure $next)
    {
        if (Auth::user()->gid < 1) {
            return response()->json([
                'status'  => true,
                'code'    => 400007,
                'message' => config('errorcode.code')[400007],
                'data'    => '级别不符',
            ]);
        }
        else{

            return $next($request);

        }

    }
}